#include "gofgame/jumpdown/sprite/SolidPedal.h"
#include "gofgame/jumpdown/util/objective-c.h"
#include "SimpleAudioEngine.h"
#include "gofgame/jumpdown/sprite/Hero.h"

using namespace gofgame::jumpdown::sprite;
using namespace gofgame::jumpdown::util;
using namespace CocosDenshion;

SolidPedal::SolidPedal() {
	
}

bool SolidPedal::init() {
	if (!Pedal::initWithSpriteFrameName("nor1.png")) {
		delete this;
		return false;
	}
	return true;
}

SolidPedal::~SolidPedal() {
	std::cout << "solid pedal" << std::endl;
}

/* static */ SolidPedal *SolidPedal::createSolidPedal() {
	SolidPedal *solidPedal;
	if (oc_new<SolidPedal>(&solidPedal)) { 
		solidPedal->autorelease();
	}
	return solidPedal;
}

bool SolidPedal::onTouchHero(Hero *hero) {
	SimpleAudioEngine::sharedEngine()->playEffect("g2normal.wav");
	hero->recoverHp();
	return true;
}